package jackson.src.day02;

/*
 * Author: JacksonCoder
 * FileName: superExtends
 * Version: 1.0.0
 */
public class superExtends {

    public static void main(String[] args) {
        System.out.println("the function start！！！");
        Q q = new Q("alex",83,843);
        System.out.println("name:" + q.name + " age: " + q.age + " score: " + q.score);
    }
}

class P {
    protected String name;

    protected int age;

    public P(String name, int age) {
        this.name = name;
        this.age = age;
    }
}

class Q extends P {
    protected int score;

    public Q(String name, int age, int score){
        super(name,age); // 自动调用父类的构造方法
        this.score = score;
    }

}